@import "ui-variables";
@import "syntax-variables";

.list-tree.has-collapsable-children .list-nested-item > .list-item.loading:before {
  content: "\f087"; // 'sync' icon, spinning arrows
}

/*
 * Styles below taken from Atom's [tree-view][0] to ensure nuclide-file-tree looks exactly the same.
 *
 * [0] https://github.com/atom/tree-view
 */
.tree-view {
  flex-grow: 1;
  flex-shrink: 0;
  min-height: min-content; // Switched from tree-view's `100%` to fill height of scroller.
  padding-left: @component-icon-padding;
  padding-right: @component-padding;
  position: relative;
  width: 100%;

  .header {
    position: relative;
  }

  .list-tree {
    min-width: min-content;
    position: static;
  }

  .entry {
    // This fixes https://github.com/atom/tree-view/issues/110, see that issue for more details
    &:before {
      content: '';
      position: absolute;
    }
  }

  .nuclide-ui-checkbox[type="checkbox"] {
    &:indeterminate {
      background-color: @text-color-warning;
    }
    &:checked,
    &:active {
      background-color: @background-color-success;
    }

    // Note: Atom applies transitions to the checkmarks, but when applied to
    // hundreds of checkboxes simultaneously as is the case in the
    // 'nuclide-file-tree' package w/Working Sets, they are too expensive to
    // paint. The followings styles intentionally omit transitions.
    &,
    &:before,
    &:after {
      transition: none;
    }
  }

}

.nuclide-file-tree-filter {
  &.not-found {
    color: @text-color-error;
  }
  font-weight: bold;
  position: absolute;
  margin-top: @component-padding;
  left: @component-padding;
  z-index: 1;
  background: @overlay-background-color;
  padding: @component-padding/2 @component-padding;
  border: 1px solid @overlay-border-color;
  transition: opacity 0.5s;
  display: none;
}

.nuclide-file-tree-entry-highlight {
  color: @text-color-highlight;
  font-weight: bold;
}

.nuclide-file-tree-fixed {
  position: relative;
}

.nuclide-file-tree-toolbar {
  margin-top: 10px;
  position: absolute;
  right: 30px;
  z-index: 1;
}

.nuclide-file-tree-toolbar-container {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  background-color: @tree-view-background-color;
}

.nuclide-file-tree-toolbar-fader {
  opacity: 0;
  transition: opacity 0.35s ease-in-out;
}

.nuclide-file-tree-toolbar-container:hover .nuclide-file-tree-toolbar-fader {
  opacity: 1;
}

.nuclide-file-tree .list-item .nuclide-ui-checkbox-label {
  margin-right: 5px;
}

.nuclide-file-tree-softened {
  opacity: 0.4;
}


.nuclide-file-tree-locked-height {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
}

.nuclide-file-tree-working-set-name-missing {
  visibility: hidden;
}

// matches the margin in .inline-block-tight
.nuclide-file-tree-connection-title {
  margin-left: @component-padding/2;
}

.nuclide-file-tree-open-files-section {
  display: flex;
  flex-direction: column;
}

.nuclide-file-tree-open-files-section > .nuclide-ui-section-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.nuclide-file-tree-open-files {
  display: flex;
  max-height: 20vh;
}

.nuclide-file-tree-open-files-list {
  position: relative;
  width: 100%;

  .list-item:hover {
    color: @text-color-highlight;
  }

  .icon-primitive-dot:before,
  .icon-x:before {
    font-size: 12px;
    height: @component-icon-size;
    width: @component-icon-size;
  }
}

.nuclide-file-tree-open-files-row {
  display: flex;
  width: 100%;
}

.nuclide-file-tree-section-caption {
  padding-left: 5px;
  padding-right: 5px;
}

.nuclide-file-tree-spinner {
  position: absolute;
}

.nuclide-file-tree-sidebar-uncommitted-changes {
  display: flex;
  max-height: 20vh;
}

.nuclide-file-tree .list-item::before {
  vertical-align: middle;
}
